package org.starsource.forum.server.transaction;

import org.starsource.forum.client.exception.DatabaseException;
import org.starsource.forum.client.exception.LoginLogNotFoundException;
import org.starsource.forum.client.exception.UserNotFoundException;
import org.starsource.forum.server.domain.LoginLog;
import org.starsource.forum.server.domain.User;

public interface UserTransaction {

	public User createUser(String account, String password, String name, String directory) throws DatabaseException;
	public void updateUser(User user) throws DatabaseException;
	public void removeUser(User user) throws DatabaseException;
	
	public User getUser(int id) throws UserNotFoundException, DatabaseException;
	public User getUser(String account) throws UserNotFoundException, DatabaseException;
	public User getUser(String account, String password) throws UserNotFoundException, DatabaseException;

    public void loginSuccess(User user, String ip) throws DatabaseException;
	public LoginLog getLastVisit(User user) throws LoginLogNotFoundException, DatabaseException;
}
